package com.newretail.springboot.controller;

import com.newretail.springboot.entity.City;
import com.newretail.springboot.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:gaoxu;
 * @Email:gaoxu@benlai.com
 * @DATE:2017-12-28
 * @version:ver1.0.0
 * @Description: Created by gaoxu on 2017-12-28.
 */

@RestController
@RequestMapping("/city")
public class CityControlller {

    @Autowired
    private ICityService cityService;

    @GetMapping("/getCity/id/{id}")
    public City getCityById(@PathVariable("id") long id){
        return cityService.getCityById(id);
    }
}
